<template>
  <div class="person-center">
    <!-- 个人信息 -->
    <div class="head-card">
      <div>
        <div>
          <van-image
            round
            width="88px"
            height="88px"
            :src="require('@/assets/imgs/personCenter/header.png')"
          />
        </div>
        <span class="name">张三</span>
        <span class="car-card">常用车牌：川R66666</span>
      </div>
      <div @click="toMyCode">
        <span>我的二维码</span>
        <span>
          <i class="iconfont icon-icon-test"></i>
        </span>
      </div>
    </div>
    <!-- 车辆绑定 异常上报 -->
    <div class="car-bind">
      <div v-for="(item,index) in list" :key="index" @click="theIconClick(item.router)">
        <van-image round width="44px" height="44px" :src="item.img" />
        <br />
        <span class="text-sty">{{item.text}}</span>
      </div>
    </div>

    <div class="login-out">退出登录</div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      list: [
        {
          img: require("../../../assets/imgs/personCenter/车辆绑定.png"),
          text: "车辆绑定",
          router: "/carBind",
        },
        {
          img: require("../../../assets/imgs/personCenter/异常上报.png"),
          text: "异常上报",
          router: "",
        },
      ],
    };
  },
  methods: {
    theIconClick(router) {
      this.$router.push({
        path: router,
      });
    },
    toMyCode() {
      this.$router.push({
        path: '/mycode',
      });
    },
  },
  //请求数据
  created() {},
};
</script>

<style scoped lang ='less' >
.person-center {
  width: 100vw;
  height: 85px;
  color: #000;
  background-image: linear-gradient(to bottom, #007bf4, #00a1f8);
  padding-top: 88px;
  .head-card {
    height: 246px;
    background-color: #ffffff;
    padding-top: 29px;
    width: 85vw;
    margin: 0px auto;
    border-radius: 15px;
    text-align: center;
    & > div:nth-child(1) {
      display: flex;
      flex-direction: column;
      align-items: center;
      padding-bottom: 30px;
      border-bottom: 1px solid #d5d5d5;
      & > div {
        width: 88px;
        height: 88px;
        /* border: 1px dashed #707070 ; */
      }
      .name {
        display: block;
        color: #333333;
        font-size: 25px;
      }
      .car-card {
        font-size: 14px;
        color: #707070;
      }
    }
    & > div:nth-child(2) {
      padding: 20px;
      display: flex;
      justify-content: space-between;
      & > span {
        font-size: 17px;
        color: #707070;
      }
    }
  }
  .car-bind {
    height: 119px;
    margin: 20px;
    background-color: #ffffff;
    border-radius: 15px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    & > div {
      width: 33.33333%;
      text-align: center;
      .text-sty {
        display: block;
        color: #707070;
        margin-top: 5px;
      }
    }
  }
  .login-out {
    margin: 20px;
    height: 50px;
    background-color: #ffffff;
    border-radius: 15px;
    line-height: 50px;
    text-align: center;
    color: #007bf5;
    font-size: 16px;
  }
}
</style>
